package me.macd.mindoc.config.shiro;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.CredentialsMatcher;
import org.springframework.stereotype.Component;

/**
 * @program: mindoc
 * @description: ${description}
 * @author: 2018-09-21
 * @create: 2018-09-21 22:05
 */

@Component
public class MinDocMatcher implements CredentialsMatcher {
    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
        if ("admin".equals(token.getPrincipal())) {
            return true;
        }
        return false;
    }
}
